package com.wfs.thisdemo;

public class Student {
    String name;
    int age;
    double math;
    double chinese;
    double english;
    // 无参构造器
    public Student() {
        System.out.println("-----------执行无参构造器---------");
    }
    // 有参构造器
    public Student(String name, int age, double math, double chinese, double english) {
        System.out.println("-----------执行有参构造器---------");
        this.name = name;
        this.age = age;
        this.math = math;
        this.chinese = chinese;
        this.english = english;
    }
    public Double getAverage() {
        double average = (this.math + this.chinese + this.english) / 3;
        return average;
    }
}
